<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>vue中的列表渲染以及vue中set方法的使用</title>
    <script src="./js/vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 使用template标签 不会被渲染 -->
        <template v-for="(item, index) of list1" :key="item.id">
            <div>{{item.text}} --- {{index}}</div>
            <span>id为：{{item.id}}</span>           
        </template>
        <br/>
        <div v-for="item of list">
            {{item}}
        </div>
        <br />
        <div></div>
        <div>循环对象</div>
        <!-- 循环对象 -->
        <div v-for="(item, key, index) of userInfo">
            {{item}} --- {{key}} --- {{index}}
        </div>
    </div>
    <script>
        var vm = new Vue({
            el: "#app",
            data: {
                list: ["hello", "vue", "I", "am", "coming"],
                list1: [
                    {id: "1000231", text: "hello", age: 18},
                    {id: "1000232", text: "hello2", age: 12},
                    {id: "1000233", text: "hello3", age: 12},
                ],
                userInfo: {
                    name: "ty",
                    age: 24,
                    gender: "famale",
                    salary: "secret"
                }
            }
        });
    </script>
</body>
</html>